package com.lin.handler;

import com.lin.common.rest.BaseReqMsg;
import com.lin.common.rest.ReqMsg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

@Component("modifyRequestBodyHandler")
public class ModifyRequestBodyHandler implements ModifyBodyHandler {
    private static final Logger log = LoggerFactory.getLogger(ModifyRequestBodyHandler.class);

    @Override
    public Mono modifyBody(BaseReqMsg reqMsg) {
        log.info("BaseReqMsg: {}", BaseReqMsg.class.getSimpleName());
        ReqMsg rm = new ReqMsg();
        rm.setRandom(reqMsg.getClass().getSimpleName());
        return Mono.just(rm);
    }

}
